//
//  MDCoordinatorManager.m
//  MvvmDemo
//
//  Created by 吴伟城 on 2018/12/16.
//  Copyright © 2018 吴伟城. All rights reserved.
//

#import "MDCoordinatorManager.h"
#import "MDLoginCoordinator.h"
#import "MDHomeCoordinator.h"

@interface MDCoordinatorManager () <MDLoginCoordinatorDelegate>

@property (strong, nonatomic) MDLoginCoordinator *loginCoordinator;
@property (strong, nonatomic) MDHomeCoordinator *homeCoordinator;

@end

@implementation MDCoordinatorManager

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  self.loginCoordinator = [[MDLoginCoordinator alloc] initWithNavigationController:self.navigationController];
  self.loginCoordinator.delegate = self;
  [self.loginCoordinator showLogin];
  return YES;
}

#pragma mark - <MDLoginCoordinatorDelegate>

- (void)loginCoordinatorShouldShowHomeVC:(MDLoginCoordinator *)loginCoordinator {
  self.homeCoordinator = [[MDHomeCoordinator alloc] initWithNavigationController:self.navigationController];
  [self.homeCoordinator showHome];
}

@end
